home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batsec.zip / CHAPT3 < prev    next >
Text File  |  1992-03-03  |  10KB  |  327 lines

  1.  
  2.  
  3.                             CHAPTER 3
  4.  
  5.                         COLOR COMBINATIONS
  6.  
  7.         In This Chapter You Will Learn:
  8.         To Write 64 color combinations
  9.         Experiment with 1 and 2-letter color codes
  10.         Create A Color Menu
  11.  
  12.         WRITING YOUR OWN COLOR COMBINATIONS
  13.         There are 8 colors that you will be using for the
  14.         foreground (for letters) and eight for the background.
  15.         This gives you 64 combinations from which to select your
  16.         favorite colors.
  17.  
  18.         One approach to writing these codes is to use a simple
  19.         formula for a set of 8 background colors and a set of 8
  20.         foreground (letters). This is easily done by using the first
  21.         letter of each color: for example, R for red letters, and
  22.         RB for red background. This code will also serve as the
  23.         name of the Batch file.
  24.  
  25.   
  26.         A SPEED COURSE IN INSTANT COLOR
  27.         The Batch Files that you will be writing have been
  28.         designed by the Author to change foreground or background
  29.         color individually or together.
  30.  
  31.         The Batch Files that you write will contain the commands
  32.         Echo Off and Clear Screen (Cls). Other information about the
  33.         Batch File is described below.
  34.         ▀  The Echo off command will prevent the  codes from
  35.         appearing on the screen.
  36.  
  37.         ▀  The Clear command will then clear the Echo Off
  38.           command from the screen.
  39.  
  40.         ▀  When you enter a Letter command on the keyboard and
  41.            press Enter, the Prompt and text will appear in that color.
  42.  
  43.         ▀  When you enter a Background command, the screen
  44.            color will change.
  45.  
  46.         ▀  When you enter a letter (Y) and a background color
  47.            (BB) the screen will show both color changes
  48.            simultaneously.
  49.  
  50.         ▀  Each Batch File will contain a "Variable Parameter
  51.            <%1>". This will make the Batch File accept another
  52.            Batch File.  This is how you can have the two colors
  53.            change at the same time.
  54.  
  55.         ▀   The Directory command "DIR" will be included each Batch
  56.             File. Since this is the last command in each Bat file it will
  57.             provide text material to view with the color changes.
  58.  
  59.             Note the second item in each Batch file uses the variable %1.
  60.             This is where the second Batch file is activated
  61.             (executes).
  62.                               -9-
  63.  
  64.  
  65.  
  66.  
  67.  
  68.             For example, if you want yellow letters and blue background, the
  69.             yellow letters execute first, then the blue background executes
  70.             second from the variable %1.
  71.  
  72.         By using a variable you can substitute any color for %1. In
  73.         the case above you could replace the blue background with any
  74.         of the eight colors.
  75.  
  76.         The last item in each Bat file is the Directory command "DIR.
  77.         This means whichever Batch file you use the program
  78.         will always end with a display on the screen of the files
  79.         in the directory.
  80.  
  81.  
  82.         PUTTING COLOR CODES INTO A MENU
  83.         Another way to check color is to put the list of color codes
  84.         into a 2-letter Menu. Each time you make a color selection,
  85.         you can return to the Menu by entering 2L.  This will give you
  86.         some color to look at while making your next selection.
  87.  
  88.  
  89.         HOW TO WRITE THE 2L MENU APPEARS BELOW.
  90.  
  91.         The Menu is Written Like This:
  92.         Type next to the A> prompt the following, like this:
  93.  
  94.         Copy Con 2L.Bat
  95.         Prompt $p$g
  96.         Echo off
  97.         Cls
  98.         Echo:====== 1 and 2-Letter Color Codes ======
  99.         Echo:
  100.         Echo:  Select 1 color from either column, or 2 colors,
  101.         Echo:  1 for Letters and 1 for Background
  102.         Echo:       Then Press Enter Key
  103.         Echo:
  104.         Echo:   R...Red letters        RB... Red background
  105.         Echo:   G...Green letters      GB...Green background
  106.         Echo:   Y...Yellow letters     YB..Yellow background
  107.         Echo:
  108.         Echo:   B...Blue letters       BB...Blue background
  109.         Echo:   M...Magenta letters    MB.Magenta background
  110.         Echo:   CY..Cyan letters       CB...Cyan background
  111.         Echo:
  112.         Echo:   W...White letters      WB...White background
  113.         Echo:   BLK..Black letters     BLB..Black background
  114.         Echo:============================
  115.         Press F6 key, then press Enter key to finish Batch file.
  116. ---------
  117.         You have completed the 2L Menu Bat File.
  118.         It will be used in all the color Bat files. When a color
  119.         appears on the screen it will always display the 2L Menu.
  120.  
  121.         COLOR CODES
  122.         The next lessons use many of the DOS commands that you
  123.         have learned thus far. The Batch files contain a good
  124.         variety of color codes, parameters, and DOS
  125.         commands. You will enjoy how fast these Speed keys operate.
  126.                               -10-
  127.  
  128.  
  129.  
  130.  
  131.  
  132.         WRITING THE COLOR CODE BAT FILES
  133.         We'll Start With the Background Colors.
  134.         Type the following next to the A> Prompt,
  135.         Like this:          <Press Enter Key after each line.>
  136.  
  137.                 Copy Con BLB.Bat     (Black background)*
  138.                 Prompt $e[40m $p$g
  139.                 %1
  140.                 Echo off
  141.                 Cls
  142.                 2L.Bat
  143.                 Press F6 key, then press Enter key.
  144. ---------------
  145.  
  146.                 Copy Con RB.Bat            (Red background)
  147.                 Prompt $e[41m  $p$g
  148.                 %1
  149.                 Echo off
  150.                 Cls
  151.                 2L.Bat
  152.                 Press F6 key, then press Enter key.
  153. ----------------
  154.  
  155.                 Copy Con GB.Bat       (Green background)
  156.                 Prompt $e[42m  $p$g
  157.                 %1
  158.                 Echo off
  159.                 Cls
  160.                 2L.Bat
  161.                 Press F6 key, then press Enter key.
  162. --------------
  163.  
  164.                 Copy Con YB.Bat         (Yellow background)
  165.                 Prompt $e[43m  $p$g
  166.                 %1
  167.                 Echo off
  168.                 Cls
  169.                 2L.Bat
  170.                 Press F6 key, then press Enter key.
  171. --------------
  172.  
  173.                 Copy Con BB.Bat         (Blue background)
  174.                 Prompt $e[44m  $p$g
  175.                 %1
  176.                 Echo off
  177.                 Cls
  178.                 2L.Bat
  179.                 Press F6 key, then presss Enter key.
  180. ---------------                                               
  181.                                                  
  182.  
  183.                 Copy Con MB.Bat     (Magenta background)
  184.                 Prompt $e[45m  $p$g
  185.                 %1
  186.                 Echo off
  187.                 Cls
  188.                 2L.Bat
  189.                 Press F6 key, then press Enter key.
  190. ----------------
  191.  
  192.                              -11-
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                 Copy Con CB.Bat       (Cyan background>
  199.                 Prompt $e[46m  $p$g
  200.                 %1
  201.                 Echo off
  202.                 Cls
  203.                 2L.Bat
  204.                 Press F6 key, then press Enter key.
  205. ---------------
  206.                                                    
  207.                 Copy Con WB.Bat       (White background)
  208.                 Prompt $e[47m  $p$g
  209.                 %1
  210.                 Echo off
  211.                 Cls
  212.                 2L.Bat
  213.                 Press F6 key, the press Enter key.
  214. ---------------
  215.                                       
  216. In The Next Group Are The Codes For The Letters (Foreground).
  217.  
  218.                 Copy Con BLK.BAT           (Black letters)
  219.                 Prompt $e[30m  $p$g
  220.                 %1
  221.                 Echo off
  222.                 Cls
  223.                 2L.Bat
  224.                 Press F6 key, the press Enter key.
  225. --------------
  226.  
  227.                 Copy Con R.Bat           (Red letters)
  228.                 Prompt $e[1;31m  $p$g
  229.                 %1
  230.                 Echo off
  231.                 Cls
  232.                 2L.Bat
  233.                 Press F6 key, then press Enter key.
  234. --------------
  235.  
  236.                 Copy Con G.Bat           (Green letters)
  237.